<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
    <head>
	    <title></title>
	    <meta charset="utf-8">
	    <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
	    <link rel="stylesheet" href="../../skin/base.css">
	    <link rel="stylesheet" href="css/index.css">
	    <script src="../../js/zy_control.js"></script>
	    <script src="../../js/zy_click.js"></script>
		<script src="../../js/config.js"></script>
	</head>
	<body>
		<div id="main" class="loading">
			<table id="tab" class="none">
				<colgroup>
					<col style="width:35%" />
					<col style="width:35%" />
					<col style="width:20%" />
					<col style="width:10%" />
				</colgroup>
				<tbody id="list"></tbody>
			</table>
		</div>
	</body>
	<script>
	zy_init();
	function jump(id,code,station){
		localStorage['apps_train_id']=id;
		localStorage['apps_train_code']=code;
		localStorage['apps_train_station']=station;
		uexWindow.open('apps_train_item','0','item.html','2','', '',0);
	}	
	function getMain(t){
		$$('main').className='loading';
		var url = app_path+'index.php?m=iappTrain&c=app&a=lists';
		uexXmlHttpMgr.open(t,'post',url,"8000");
		uexXmlHttpMgr.send(t);

	}
	window.uexOnload=function(type){
		if (!type){
			uexWindow.setBounce("1");
			uexWindow.setBounceParams("0",'{"imagePath":"res://loading.png","textColor":"#666","levelText":"","pullToReloadText":"拖动刷新","releaseToReloadText":"释放刷新","loadingText":"加载中，请稍等"}');
            uexWindow.showBounceView("0","#f3f3f3","1");
            uexWindow.notifyBounceEvent("0","1");
			
			uexWindow.onBounceStateChange=function(t,s){
	　　　　　　	if(t=="0"){
	　　　　　　　　	if(s=="2"){
						getMain(t);
					}
	　　　　　　	}
	　　　　	}
			
			uexXmlHttpMgr.onData = function(opId, status, data){
				if(status==1){
					$$('main').className='';
					if(opId<1){					
						uexWindow.setBounceParams("0",'{"imagePath":"res://loading.png","textColor":"#666","levelText":"上次更新：'+Now()+'","pullToReloadText":"拖动刷新","releaseToReloadText":"释放刷新","loadingText":"加载中，请稍等"}');
					}
					uexXmlHttpMgr.close(opId);
					uexWindow.resetBounceView(opId);
					data = JSON.parse(data);
					if(data['success']=='OK'){
						data=data['data'];			
						var listHtml='';
						for(var i=0;i<data.length;i++){					
							listHtml+='<tr ontouchstart="zy_touch(\'down\')" onclick="jump('+data[i]['trainid']+',\''+data[i]['trainCode']+'\',\''+data[i]['traindeptStation']+'-'+data[i]['trainArriveStation']+'\')">'+
							'<td><strong>'+data[i]['trainCode']+'</strong><span>'+data[i]['trainType']+'</span></td>'+
							'<td><span>'+data[i]['trainsearchStation']+'</span><span>'+data[i]['traindeptStation']+'-'+data[i]['trainArriveStation']+'</span></td>'+
							'<td><span>'+data[i]['traindeptTime']+'</span><span>'+data[i]['trainarriveTime']+'</span></td>'+
							'<th></th></tr>';			
						}
						$$('tab').className='';
						$$('list').innerHTML=listHtml;
					}else{	
						uexWindow.toast("0","5",data['msg'],1000);
					}
					
					
				}else if(status ==-1) {//加载失败
					uexXmlHttpMgr.close(opId);
					uexWindow.resetBounceView(opId);
					uexWindow.toast("0","5",'加载失败',1000);
				}
			}
			getMain(-1);
		}
	}
	</script>
</html>